#!/bin/bash

echo -e "\nBuilding module: verifymodule.so"
echo -e "\nGenerating interface..."
swig -python -c++ verifymodule.i

echo -e "Compiling cpp source..."
g++ -O2 -fPIC -c verifymodule.cpp

echo -e "Compiling wrapper code..."
g++ -O2 -fPIC -c verifymodule_wrap.cxx -I /usr/include/python2.7

echo -e "Linking them together..."
g++ -shared verifymodule.o verifymodule_wrap.o -o _verifymodule.so

# Cleanup
rm -f *.cxx
rm -f *.o

# Copy new module
cp _verifymodule.so ../
